function! trainer#core#start() abort
    call trainer#python#init_python()
    call trainer#ui#create_layout()

endfunction

function! trainer#core#load_task_json(json_path) abort
    python3 << EOF
try:
    json_path = vim.eval('a:json_path')
    task_data = tm.manager.load_task_json(json_path)
    vim.command('call trainer#core#enable_check()')
except Exception as e:
    vim.command('echo "Failed to load task json: %s"' % e)
EOF
endfunction

function! trainer#core#enable_check() abort
    if !exists('g:tracker_enabled')
        set updatetime=2000
        augroup TrackerCommands
        autocmd!
        autocmd CursorHold,CursorHoldI * python3  tm.manager.check()
        augroup END
        let g:tracker_enabled = 1
        echo "Tracker enabled"
    endif
endfunction